/**
 * @param {callback}
 * **/
import { $t } from '@/utils/vue_pbulic'
import { Action } from 'element-plus'

export const $itemActionTip = (
  callbackFun: () => void,
  type: '' | 'success' | 'warning' | 'info' | 'error' = 'warning',
  tip: string = $t('common.deleteTip')
) => {
  ElMessageBox.confirm(tip, $t('common.tip'), {
    type,
    callback: (action: Action) => {
      if (action === 'confirm') {
        callbackFun()
      }
    }
  })
}
